"DESCRIPTION 1"="When you run the Mozilla executable, normally just the web browser (Navigator) runs. Here, you can allow some of the other programs to run."
"DESCRIPTION 2"="NOTE: This will affect all users of Mozilla on this computer."
"DESCRIPTION 3"="Mozilla is free, open source web browser available from http://www.mozilla.org/ ."
"AUTHOR"="Xteq Systems (Neil R. Turner)"
"CONTACTURL"="http://www.xteq.com"
"COPYRIGHT"="Copyright ⌐ Xteq Systems - All Rights Reserved"
"COMMENT 1"="Rules of programming #46346: Never write plugins with a hangover."
' Neil's attempt at creating a Mozilla plug-in for X-Setup. As you can see, it's a little
' complicated due to the way Mozilla stores its settings (ie in a completely non-standard
' format... so much for a standards compliance, eh?), so that's why the code is slightly
' more sloppy then usual. But it works. I think.
'
' Feel free to copy code elements for use in other Mozilla/Netscape plugins.
sP="HKCU\Software\mozilla.org\Mozilla\"
sV1="CurrentVersion"
sV2="\Main\Install Directory"
Sub Plugin_Initialize
' To find out where the Mozilla keys are stored, we have to go get the version number.
MozVer=RegReadValue(sP&sV1)
if IsEmpty(MozVer)=true then
Call Disable()
else
' This tells us where Mozilla is installed, so that we can open the preferences files.
InsPath=RegReadValue(sP&MozVer&sV2)
end if
' Open all.js, which seems to be the main preference file.
Call TxtOpen(InsPath&"defaults\pref\all.js")
' Because we repeat a rather longwinded peace of code to get each setting, we use a SUB,
' and provide it with the name of the value and what we would expect it to say if it was
' on - for some reason Mozilla likes to put loads of spaces in, thus requiring more code.
' It makes it easier to read, but from an X-Setup point of view, it's annoying. Grrrrrrr.
i=InStr(s,",") ' We're only interested in the stuff after the comma, so we get rid of the left hand side.
s=Right(s,len(s)-i)
if s=Setting then ' If what we've retrieved is the same as what we were expecting, then we set the UI elephant to true.
Call SetUIElement(Num,true)
end if
else
' The prefs files may only be written on first launch or be corrupted, so if the item
' can't be found, we let the user know.
Call MsgWarning("X-Setup encountered an error while trying to retrieve the settings. This may be because you have not run Mozilla yet, or the preferences are corrupted. Please run Mozilla, or reinstall it.")
Call Disable()
end if
End Sub
Sub Plugin_Apply(ElementIndex,ElementSubIndex)
' Yup, we need this again... Though since the plugin would already be disabled if it